<template>
  <div class="wrapper">
            <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item>订单管理</el-breadcrumb-item>
                <el-breadcrumb-item>订单列表</el-breadcrumb-item>
            </el-breadcrumb>
            <el-card>
                <el-row>
                    <el-col  :span="10">
                            <el-input placeholder="请输入内容" v-model="input3" class="input-with-select">
                                    <el-button slot="append" icon="el-icon-search" @click="ss"></el-button>
                            </el-input>
                    </el-col>
                </el-row>
                    <el-table :data="orders" >
                            <el-table-column
                            prop="order_number"
                            label="订单编号"
                            width="180">
                            </el-table-column>
                             <el-table-column
                            prop="order_price"
                            label="订单价格"
                            width="180">
                            </el-table-column>
                             <el-table-column
                            prop="pay_status"
                            label="是否付款"
                            width="180">
                              <template slot-scope="scope">
                                    <el-tag v-if="scope.row.pay_status==1"  >
                                            已付款
                                    </el-tag>
                                      <el-tag v-if="scope.row.pay_status==0" type="danger" >
                                            未付款
                                    </el-tag>
                              </template>

                            </el-table-column>
                             <el-table-column
                            prop="is_send"
                            label="是否发货"
                            width="180">
                            </el-table-column>
                            <el-table-column
                           
                            label="下单时间"
                            width="180">
                             <template slot-scope="scope">
                                     
                                     {{ scope.row.create_time |  timeFormat }}

                             </template>

                            </el-table-column>
                            <el-table-column
                           
                            label="操作"
                            >
                              <template slot-scope="scope">
                                    <el-button>
                                         修改
                                    </el-button>
                                      <el-button>
                                         查看物流
                                    </el-button>

                              </template>

         
                            </el-table-column>



                    </el-table>

                    <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="currentPage4"
                        :page-sizes="[2, 4, 6, 10]"
                        :page-size="100"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="t">
                    </el-pagination>
            </el-card>
  </div>
</template>

<script>
export default {
  components:{},
  props:{},
  data(){
    return {
        queryData:{
            query:"",
            pagenum:1,
            pagesize:2
        },
        orders:[],
        input3:'',
        t:0,
        currentPage4:1
    }
  },
  watch:{},
  computed:{},
  methods:{
    ss(){//搜索功能
        
    }, 
      handleSizeChange(v){//修改每页的条数
             
            this.queryData.pagesize = v;
            this.getData()
      },
      handleCurrentChange(v){//点击页码时的方法
            this.queryData.pagenum = v;
            this.getData()
      },
      async getData(){

        var d =  await this.$http.get("/orders",{
                params:this.queryData
            })

            console.log(d)

            this.orders = d.data.data.goods
            this.t = d.data.data.total
      }
  },
  created(){
      
      this.getData()
   
  },
  mounted(){}
}
</script>
<style scoped>
.el-card{
    margin-top: 30px;

}
</style>